import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import router from './router'
// import { createPinia } from 'pinia'
// import persist from 'pinia-plugin-persistedstate'
import axios from './utils/request'

// import createPreviewTheme from '@kangc/v-md-editor/lib/theme/preview.js';
import VueMarkdownEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';
import Prism from 'prismjs';

import { createPinia } from 'pinia'
import persist from 'pinia-plugin-persistedstate'


import App from './App.vue'

const app = createApp(App)


VueMarkdownEditor.use(vuepressTheme, {
    Prism,
    config: {
        toc: {
          includeLevel: [3, 4],
        },
      },
      
});

// app.use(createPinia().use(persist))
app.use(ElementPlus).use(router).use(VueMarkdownEditor).use(createPinia().use(persist))
app.config.globalProperties.axios = axios; // 将axios挂载到全局
app.config.globalProperties.$imageUrlPre = axios.defaults.baseURL + "/file/downloadImage?filePath="; // 图片url前缀
app.mount('#app')
